package services;


import edu.ipfw.services.patron.*;
import edu.ipfw.fitness.*;
import javax.jws.WebService;

import org.jboss.ws.annotation.EndpointConfig;

import data.DbPatron;

@WebService(serviceName = "Patron", endpointInterface = "edu.ipfw.services.patron.PatronService", targetNamespace = "http://ipfw.edu/services/patron")
@EndpointConfig(configName="Standard WSSecurity Endpoint")
public class PatronServiceImpl implements PatronService {

	DbPatron db = new DbPatron();
	
	public int getVisitsForDateRange(
			javax.xml.datatype.XMLGregorianCalendar startDateTime,
			javax.xml.datatype.XMLGregorianCalendar endDateTime,
			java.lang.String id) throws PatronNotFoundFault {
			return db.getVisitForDateRange(startDateTime, endDateTime, id);
	}
	
	public int getVisitsForToday(java.lang.String id)
			throws PatronNotFoundFault {
		return db.getVisitForToday(id);

	}

	public PatronIdListType getMembersForExpDate(
			javax.xml.datatype.XMLGregorianCalendar expirationDate) {
		return db.getMembersForExpDate(expirationDate);
	}


	public PatronIdListType getMembersForType(
			MembershipType membershipType) {
				return db.getMembersForType(membershipType);
	}

	public PatronType getMember(java.lang.String id)
			throws PatronNotFoundFault {
		return db.getPatron(id);
	}

	
	public long getAvgVisitDuration(java.lang.String id)
			throws PatronNotFoundFault {
		return db.getAvgDuration(id);
	}
	


}